package com.dongdongshop.consumer;

import com.dongdongshop.controller.MessageController;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "dk2206", topic = "dk2206-topic")
public class MyConsumer implements RocketMQListener<String> {


    @Autowired
    private StringRedisTemplate redsi;
    @Autowired
    private MessageController mc;

    @Override
    public void onMessage(String phoneNum) {
        System.out.println(phoneNum);
        mc.sendMessage(phoneNum);
    }


}